{layout '../Public/layoutList.latte'} {*继承layoutList模板*}
{block title}部门人均得分{/block}

{block private_css}
    <style type="text/css">
        .item-search-box{
            width:30%;
            float:left;
        }

        .item-search-box .item-search-border{
            margin:10px;
            padding:20px;
            border:1px solid #dddddd;
        }

        .item-search-bar{
            width:100%;
            margin-bottom:20px;
        }

        .item-search-input{
            width: 100%;
            height:25px;
            line-height:25px;
        }

        .item-inner{
            width:100%;
            margin:0.1rem;
        }

        .item-inner .item-title-depament{
            padding:0.5rem;
            background:#f7f7f7;
            text-align:center;
        }
    </style>
{/block}
{block private_js}
{/block}
{block content}
    <div class="item-search-box">
        <div class="item-search-border">
            <div class="item-search-bar">
                <input type="text" placeholder="检索年月" name="time" class="item-search-input" value="{$year.$month}"/>
            </div>
            <ul style="list-style: none;">
                {foreach $timeArr as $k => $v}
                    <li>
                        <a class="item-content item-link" href="{url('consoles_ranking_deAveragePoints',array('year'=>$v['year'],'month'=>$v['month']))}">
                            <div class="item-inner">
                                <div class="item-title-depament" {if $year==$v['year'] && $month==$v['month']}style="background-color:#cac6c6"{/if}>
                                    {$v['str']}
                                </div>
                            </div>
                        </a>
                    </li>
                {/foreach}
            </ul>
        </div>
    </div>
    <table cellpadding="0" cellspacing="0" border="0" class="stdtable" style="width:70%;float:left">
        <thead>
        <tr>
            <th></th>
            <th data-sort="s.names"><span class="table-head">姓名</span></th> {*在th加入 data-sort 可对数据库进行排序*}
            <th><span class="table-head">总得分</span></th>
            <th data-sort="s.id"><span class="table-head">人数</span></th>
            <th><span class="table-head">人均得分</span></th>
        </tr>
        </thead>
        <tbody>
        {foreach $lists as $k=>$item}
            <tr>
                <td style="width: 60px;"><input type="checkbox" name='ids[]' class="checkall_1 checkall-item" value="{$item['s_id']}"/></td>
                <td class="wid-auto">{$item['userName']}</td>
                <td class="wid-auto">{$item['acorn']}</td>
                <td class="wid-auto">{$item['num']}</td>
                <td class="wid-auto">{$item['acorn']/$item['num']|coin:2}</td>
            </tr>
        {/foreach}
        {foreach $staff as $k=>$item}
            <tr>
                <td style="width: 60px;"><input type="checkbox" name='ids[]' class="checkall_1 checkall-item" value="{$item['s_id']}"/></td>
                <td class="wid-auto">{$item['userName']}</td>
                <td class="wid-auto">{$item['acorn']}</td>
                <td class="wid-auto">{$item['num']}</td>
                <td class="wid-auto">{$item['acorn']/$item['num']|coin:2}</td>
            </tr>
        {/foreach}
        </tbody>
    </table>
{/block}




